function[collectedData] = trainForKNN(pictures, classes)
% Uses all the given pictures as a training dataset.
%
%   INPUT
%   pictures........test data, used for training
%   classes.........an array of class IDs specifying the ground
%                   truth of the given pictures
%   OUTPUT
%   collectedData...the collected data; can be used for kNNClassification
%                   it is an array of feature-vector - class associations,
%                   where each of them belongs to a picture; the order of
%                   them matches the input order of the pictures
%                   removing the 3rd vector equates removing the 3rd
%                   picture from the training dataset

    featureCount = 3;
    collectedData = zeros(size(classes, 2), featureCount + 1);
    for i = 1 : size(classes, 2)
        features = calculateFeatures(pictures{i});
        % the first column specifies the class id, the other ones contain
        % the feature vector values
        collectedData(i,:) = [classes(i) features];
    end
end
